﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WfActivityLibrary.common;
using System.Collections;

namespace WfActivityLibrary.control
{
	public partial class UCZw: UserControl
    {
        private MyListItem preSelectEntity;
		public UCZw()
		{
			InitializeComponent();
        }

        //加载职务信息
        public void showData()
        {
            comboBoxZw.DataSource = null;
            ArrayList list = new ArrayList();
            DataTable dataZws = new DataTable();

            MyListItem listItem = new MyListItem();
            if (preSelectEntity != null)
            {
                list.Add(preSelectEntity);
            }
            if (dataZws != null)
                foreach (DataRow dr in dataZws.Rows)
                {
                    listItem = new MyListItem();
                    listItem.TextField = dr["职务名称"].ToString();
                    listItem.ValueField = dr["jc_zwcode"].ToString();
                    list.Add(listItem);
                }
            if (list.Count != 0)
            {
                comboBoxZw.DataSource = list;
                comboBoxZw.DisplayMember = "TextField";
                comboBoxZw.ValueMember = "ValueField";
                comboBoxZw.Enabled = true;
            }
        }

        public void showData(MyListItem myListItem)
        {
            preSelectEntity = myListItem;
            showData();
        }
	}
}
